<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
 

<t:datagrid name="userList" title="分数查询" actionUrl="ScoreManageController.do?scoreQueryDatagrid" 
    fit="true" fitColumns="true" idField="id" queryMode="group" sortOrder="desc" rowStyler="scoreRoleStyle">
		<t:dgCol title="分数ID"  field="id" hidden="true"    queryMode="single"  width="120"></t:dgCol>
	<t:dgCol title="学期" field="semesterInfo.semesterName" hidden="true" query='false' replace="${semester}"></t:dgCol>
	<t:dgCol title="学号"  field="student.staffNo" query="true"  width="120"></t:dgCol>
 	<t:dgCol title="姓名" field="student.realName" query="false" width="120"></t:dgCol>
   <t:dgCol title="专业"  field="major.majorName"   queryMode="single"  query='true' width="120"></t:dgCol>
	<t:dgCol title="班级"  field="student.className" query="true"   queryMode="single"  width="120"></t:dgCol>
	<t:dgCol title="实验课程"  field="lessonInfo.lessonName"  query="true"  queryMode="single"  width="120"></t:dgCol>
		
	<t:dgCol title="项目分数"  hidden="false" field="itemScoreDetail"   formatterjs="getItemScore" queryMode="single"  width="220"></t:dgCol>	
		
	<t:dgCol title="项目1分数"  hidden="true" field="item1Score"   queryMode="single"  width="80"></t:dgCol>	
	<t:dgCol title="项目2分数"  hidden="true" field="item2Score"   queryMode="single"  width="80"></t:dgCol>
	<t:dgCol title="项目3分数"  hidden="true" field="item3Score"   queryMode="single"  width="80"></t:dgCol>
	<t:dgCol title="项目4分数"  hidden="true" field="item4Score"   queryMode="single"  width="80"></t:dgCol>
	<t:dgCol title="项目5分数"  hidden="true" field="item5Score"   queryMode="single"  width="80"></t:dgCol>		 
	
	<t:dgCol title="项目1"  field="item1Name"  hidden="true"  queryMode="single"  width="80"></t:dgCol>
	<t:dgCol title="项目2"  field="item2Name"  hidden="true"  queryMode="single"  width="80"></t:dgCol>
	<t:dgCol title="项目3"  field="item3Name"  hidden="true"  queryMode="single"  width="80"></t:dgCol>
	<t:dgCol title="项目4"  field="item4Name"  hidden="true"  queryMode="single"  width="80"></t:dgCol>
	<t:dgCol title="项目5"  field="item5Name"  hidden="true"  queryMode="single"  width="80"></t:dgCol>
	
	<t:dgCol title="总分数"  field="finalScore"   formatterjs="getScore" queryMode="single"  width="120"></t:dgCol>
	
 </t:datagrid>

<script type="text/javascript">

function scoreRoleStyle(index,row){	
	if(row.finalScore < 60){
		return "background-color:#d15b47;color:white";	
	}
	
} 

function getItemScore(v,rec){
	var result = '';
	if(rec['item1Name'] != '') result +=(rec['item1Name']+":"+rec['item1Score']+",");
	if(rec['item2Name'] != '') result +=(rec['item2Name']+":"+rec['item2Score']+",");
	if(rec['item3Name'] != '') result +=(rec['item3Name']+":"+rec['item3Score']+",");
	if(rec['item4Name'] != '') result +=(rec['item4Name']+":"+rec['item4Score']+",");
	if(rec['item5Name'] != '') result +=(rec['item5Name']+":"+rec['item5Score']);
	return result;
}   

function getScore(v){
	if(v =="" || v =="0"){
		return "--";
	}else{
		return v;
	}
}
   
 



 
</script>
